Calculate speed from the gradient of a distance–time graph